#include <stdio.h>
#include <unistd.h>

int main()
{
  int i = 0 ;
  while(1)
  {
    int ret = fork();
    if(ret < 0)
    {
      printf("fork error! i:%d\n",i);
      break;
    }
    else if(ret == 0)
    {
      //child
      while(1) sleep(1);
    }
    //parent
    i++;
  }

  return 0;
}
